//--------------------------------------------------------------------
// Pseudo Source Code of EURUSDM60LimitShortStrategy 1.21.77_250818001
//
//   Generated by StrategyQuant X Build 143 for MetaTrader5 (hedged)
//   at 02/06/2026 11:26
//
//   Backtested on EURUSD_darwinex / H1, 2019.01.01 - 2026.01.30
//   Backtest engine: MetaTrader5 (hedged)
//--------------------------------------------------------------------


//--------------------------------------------------------------------
//  Strategy Parameters
//--------------------------------------------------------------------
int MagicNumber = 11111;
int MTATRPeriod1 = 231;
double ProfitTargetCoef1 = 4.7;
double StopLossCoef1 = 2;

Main chart = Current Symbol / Current TF;

//--------------------------------------------------------------------
// Trading options logic
//--------------------------------------------------------------------

Don't Trade On Weekends = false (Friday 0038 - Sunday 0038);
Exit at End Of Day = false (2300);
Exit On Friday = true (2000);
LimitSignalsTimeRange = true (0200 - 2200, Exit at End: true, Orders to close: Pending only);
LimitMaxDistanceFromMarketPrice = false;   //Limit max distance
MaxDistanceFromMarketPct = 6;   //Max distance %
MaxTradesPerDay = 0;
Min SL: 0, Max SL: 0, Min PT: 0, Max PT: 0; // in ticks/pips, 0 means unlimited

// Template for a trading option LimitOver missing, ignoring!


//--------------------------------------------------------------------
// Trading rule: Trading signals (On Bar Open)
//--------------------------------------------------------------------           
LongEntrySignal = false;

ShortEntrySignal = ((HighestInRange(Main chart, "10:00", "15:00")[1] <= HighestInRange(Main chart, "22:30", "12:30")[1])
   and (MTATR(Main chart,MTATRPeriod1)[1] is falling for 2 bars));

LongExitSignal = false;

ShortExitSignal = false;


//--------------------------------------------------------------------
// Trading rule: Long entry (On Bar Open)
//--------------------------------------------------------------------           
if LongEntrySignal
{
}

//--------------------------------------------------------------------
// Trading rule: Short entry (On Bar Open)
//--------------------------------------------------------------------           
if (ShortEntrySignal
   and Not LongEntrySignal)
{
    // Action #1
    Open Short order at LowestInRange(Main chart, "19:30", "15:00")[1] Limit;
        Order valid for 122 bars;
		Size = according to Global MM;
		Comment = "";
		Duplicate trades = disabled;
		Replacing pending orders: allowed; 

        Stop Loss = StopLossCoef1 * ATR(5);
        Profit target = ProfitTargetCoef1 * ATR(50);
}

//--------------------------------------------------------------------
// Trading rule: Long exit (On Bar Open)
//--------------------------------------------------------------------           
if ((LongExitSignal
   and Not LongEntrySignal)
   and (MarketPosition("Any", MagicNumber, "") is Long))
{
    // Action #1
    Close all positions for Symbol = Any and Magic Number = MagicNumber;

}

//--------------------------------------------------------------------
// Trading rule: Short exit (On Bar Open)
//--------------------------------------------------------------------           
if ((ShortExitSignal
   and Not ShortEntrySignal)
   and (MarketPosition("Any", MagicNumber, "") is Short))
{
    // Action #1
    Close all positions for Symbol = Any and Magic Number = MagicNumber;

}



Broker: No filter
